////////////////////////////////////////////////////////////////////////
//
// Amuse Engine SDK - geometry/mesh
// Copyright( c) 2015.  All Rights Reserved
//
// File:		AEBaseSubmesh.inl
// Author:		Gianluca Belardelli
// Date:		30/04/2015
//
/////////////////////////////////////////////////////////////////////////
#ifndef _AEBASESUBMESH_INL_
#define _AEBASESUBMESH_INL_

AE_FORCEINLINE void AEBaseSubmesh::SetBoundingBox( const AEBoundingBox &bbBox )
{
	m_bbBoundingBox = bbBox;
}

AE_FORCEINLINE const AEBoundingBox &AEBaseSubmesh::GetBoundingBox( void ) const
{
	return m_bbBoundingBox;
}

AE_FORCEINLINE void AEBaseSubmesh::SetRenderRange( AEINT32 nStart, AEINT32 nNumIndices )
{
	m_nRenderFirstIndex = nStart;
	m_nRenderNumIndices = nNumIndices;
}

AE_FORCEINLINE void AEBaseSubmesh::GetRenderRange( AEINT32 &nStart, AEINT32 &nNumIndices ) const
{
	nStart = m_nRenderFirstIndex;
	nNumIndices = m_nRenderNumIndices;
}

AE_FORCEINLINE void AEBaseSubmesh::SetRenderVertexRange( AEINT32 nStart, AEINT32 nNumVertices )
{
	m_nRenderFirstVertex = nStart;
	m_nRenderNumVertices = nNumVertices;
}

AE_FORCEINLINE void AEBaseSubmesh::GetRenderVertexRange( AEINT32 &nStart, AEINT32 &nNumVertices ) const
{
	nStart = m_nRenderFirstVertex;
	nNumVertices = m_nRenderNumVertices;
}

AE_FORCEINLINE AEBaseMesh *AEBaseSubmesh::GetBaseRenderMesh( void ) const
{
	return m_lpMesh;
}

AE_FORCEINLINE void AEBaseSubmesh::SetMesh( AEBaseMesh *lpMesh )
{
	m_lpMesh=lpMesh;
}

AE_FORCEINLINE void AEBaseSubmesh::SetMaterial( AEMaterial *lpMaterial, AEINT16 sMaterialIndex ) 
{ 
	m_lpMaterial = lpMaterial;
	m_sMaterialIndex = sMaterialIndex;
}

/// \brief
///   Returns the submesh's material (surface).
AE_FORCEINLINE AEMaterial *AEBaseSubmesh::GetMaterial( void ) const 
{ 
	return m_lpMaterial; 
}

/// \brief
///   Returns the index of the material in the owner mesh's material list
AE_FORCEINLINE AEINT32 AEBaseSubmesh::GetMaterialIndex( void ) const 
{
	return m_sMaterialIndex;
}
#endif // _AEBASESUBMESH_INL_
